<template>
  <view class="my-search-container" :style="{ 'background-color': bgcolor }">
    <view class="my-search-box" @click="toSearch">
      <uni-icons type="search" size="18"></uni-icons>
      <text>搜索</text>
    </view>
  </view>
</template>
<script>
export default {
  name: 'my-search',
  data() {
    return {};
  },
  props: {
    bgcolor: {
      type: String,
      default: '#c00000'
    }
  },
  methods: {
    toSearch() {
      uni.navigateTo({
        url: '/subpkg/search/search'
      });
    }
  }
};
</script>
<style lang="scss">
.my-search-container {
  height: 50px;
  // background-color: #07cd5c;
  display: flex;
  align-items: center;
  padding: 0 10px;
  .my-search-box {
    height: 40px;
    background-color: #fff;
    width: 100%;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text {
      font-size: 14px;
      margin-left: 5px;
    }
  }
}
</style>
